/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dal;

import java.sql.Connection;
import java.sql.Statement;

/**
 *
 * @author Stanley
 */
public class ChiTietBaiThiDAO {

    public boolean themChiTietBaiThi(String maBT, String cauhoi, String luachon) {
//        executeUpdate("insert into ct_baithi (baithi, cauhoi, luachon) values ( "
//                    + maBT + " , " + cauhoi + " , " + luachon + " )");
        Connection connection = SqlDatabase.getInstance();
        try {
            Statement query = (Statement)connection.createStatement();
            String sql = "insert into ct_baithi (baithi, cauhoi, luachon) values ( " + 
                    maBT + " , " + cauhoi + " , " + luachon + " )";
            int result = query.executeUpdate(sql);
            return result == 0 ? false : true;
        } catch (Exception e) {
            return false;
        }
        
    }
}
